package com.gws.ievent.scheduler;

import lombok.Data;

/**
 * @author song
 * @date 2022/10/23 15:49
 */
@Data
public class SchedulerConfig {
    private static SchedulerConfig SCHEDULER_CONFIG = new SchedulerConfig();

    public static SchedulerConfig getInstance() {
        return SCHEDULER_CONFIG;
    }

    private SchedulerConfig() {}

    /**
     * 时间轮工作线程名称
     */
    private String wheelTimerThreadFactoryName = "wheel-timer";

    /**
     * 每个时间个的时间/毫秒
     */
    private long tickDuration = 100;

    /**
     * 一圈有多少个时间格
     */
    private int ticksPerWheel = 32;

    /**
     * 线程池的线程名称
     */
    private String threadPoolThreadName = "scheduler-thread-pool";

    /**
     * 核心线程数
     */
    private int corePoolSize = Runtime.getRuntime().availableProcessors();

    /**
     * 最大线程数
     */
    private int maximumPoolSize = Runtime.getRuntime().availableProcessors() * 3;

    /**
     * 存活时间/秒
     */
    private long keepAliveTime = 30;

    /**
     * 事件map初始容量
     */
    private int mapCapacity = 32;

}
